import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  }, 
  {     
     path: '/partner',
    name: 'partner',
    component: () => import('@/views/partner.vue')
  },    
  {     
    path: '/mynft',
   name: 'mynft',
   component: () => import('@/views/mynft.vue')
 },
  
{     
  path: '/investment',
 name: 'investment',
 component: () => import('@/views/investment.vue')
},
{     
  path: '/swarp',
 name: 'swarp',
 component: () => import('@/views/swarp.vue')
},
{     
  path: '/news',
 name: 'news',
 component: () => import('@/views/news.vue')
}, 
  

]

const router = new VueRouter({
  routes,
  scrollBehavior(to, from, savedPosition) {
    //设置回到顶部
    if (savedPosition) {
      return savedPosition;
    }
    return { x: 0, y: 0 };
  },
});

export default router
